package service

import (
	"fmt"
	"mojieshi/models"
)

func AddSmsModel(id int, code string) {
	//获取短信模版
	var smsData models.MSmsModel
	err := models.DB.Model(new(models.MSmsModel)).Where("id=?", id).First(&smsData).Error
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	//调用短信接口
	err = SendMsg(smsData.Tels, code, smsData.TemplateCode, smsData.SignName, id)
	if err != nil {
		fmt.Println(err.Error())
		return
	}
}
